<% @comment = comment %>
<div class="comment-border " name="comment-border">
  <div class="inline-comment-title" onclick="M_switchInlineComment(<%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>')">
    <b><%=h @comment.draft == 1 ? '(Draft)' : '' %></b>
    <%= @comment.created_at %>
    <span id="inline-preview-<%= "#{@comment.id}-#{@comment.line}-#{@comment.side}" %>" class="extra" name="inline-preview" style="visibility: hidden"><%= @comment.text.split(//)[0,10].join %></span>
  </div>
  <div id="inline-comment-<%= "#{@comment.id}-#{@comment.line}-#{@comment.side}" %>" class="inline-comment" name="inline-comment" ondblclick="M_editInlineComment(<%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>'); M_stopBubble(window, event);">
    <div name="comment-text-<%= "#{@comment.id}-#{@comment.line}-#{@comment.side}" %>" id="comment-text-<%= "#{@comment.id}-#{@comment.line}-#{@comment.side}" %>-0" class="comment-text"><%= @comment.text %></div>
    <a name="comment-reply" id="edit-link-<%= "#{@comment.id}-#{@comment.line}-#{@comment.side}" %>" href="javascript:M_editInlineComment(<%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>')"><b>Edit</b></a>
    <a name="comment-reply" id="undo-link-<%= "#{@comment.id}-#{@comment.line}-#{@comment.side}" %>" style="display:none" href="javascript:M_restoreEditInlineComment(<%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>')"><b>Undo cancel</b></a>
    <% form_tag({:controller => :issue, :action => :inline_draft}, :id => "comment-form-#{@comment.id}-#{@comment.line}-#{@comment.side}", :name => "comment-form-#{@comment.id}-#{@comment.line}-#{@comment.side}", :style => "display: none;", :method => :post) do %>
      <div name="form-container">
	<%= hidden_field :issue, :id %>
	<%= hidden_field :patchset, :id %>
	<%= hidden_field :patch, :id %>
	<%= hidden_field :comment, :snapshot %>
	<%= hidden_field :comment, :side %>
	<%= hidden_field :comment, :id %>
	<%= hidden_field :comment, :file %>
	<%= hidden_field :comment, :line %>
	<%= hidden_field :comment, :oldtext %>
	<%= text_area :comment, :text, :cols => 60, :rows => 5 %>
	<br>
	<input type="submit" name="save" value="Save" onclick="return M_submitInlineComment(this.form, <%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>')">
	<input type="reset" name="cancel" value="Cancel" onclick="M_resetAndHideInlineComment(this.form, <%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>')">
	<input type="submit" name="discard" value="Discard" onclick="return M_removeInlineComment(this.form, <%= @comment.id %>, <%= @comment.line %>, '<%= @comment.side %>')">
      </div>
    <% end %>
  </div>
</div>
<div class="comment-border" style="padding: 0"></div>
